﻿// -----------------------------------------------------------------------
// <copyright file="NetworkHelper.cs" company="Acadian Asset Management, LLC.">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace eBenefits.App.Helpers
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    /// <summary>
    /// TODO: Update summary.
    /// </summary>
    public class NetworkHelper
    {
        //private bool isIPLocal(IPAddress ipaddress)
        //{
        //    String[] straryIPAddress = ipaddress.ToString().Split(new String[] { "." }, StringSplitOptions.RemoveEmptyEntries);
        //    int[] iaryIPAddress = new int[] { int.Parse(straryIPAddress[0]), int.Parse(straryIPAddress[1]), int.Parse(straryIPAddress[2]), int.Parse(straryIPAddress[3]) };
        //    if (iaryIPAddress[0] == 10 || (iaryIPAddress[0] == 192 && iaryIPAddress[1] == 168) || (iaryIPAddress[0] == 172 && (iaryIPAddress[1] >= 16 && iaryIPAddress[1] <= 31)))
        //    {
        //        return true;
        //    }
        //    else
        //    {
        //        // IP Address is "probably" public. This doesn't catch some VPN ranges like OpenVPN and Hamachi.
        //        return false;
        //    }
        //}

        //string szRemoteAddr = Request.ServerVariables["REMOTE_ADDR"];
        //string szXForwardedFor = Request.ServerVariables["X_FORWARDED_FOR"];

        //http://www.jpsdomain.org/networking/nat.html
        //Class	                From	    To	            CIDR Mask	                Decimal Mask
        //Class "A" or 24 Bit	10.0.0.0	10.255.255.255	/8	                        255.0.0.0
        //Class "B" or 20 Bit	172.16.0.0	172.31.255.255	/12 (or more typically /16)	255.240.0.0 (or 255.255.0.0)
        //Class "C" or 16 Bit	192.168.0.0	192.168.255.255	/16 (or more typically /24)	255.255.0.0 (or 255.255.255.0)
        //10.0.0.0 to 10.255.255.255 
        //172.16.0.0 to 172.31.255.255 
        //192.168.0.0 to 192.168.255.255
    }
}
